const express=require("express");
var router=express.Router();
var pool=require("../pool");

router.get('/:bid',(req,res)=>{
  var bid = req.params.bid;
  console.log(bid)
  var sql ="SELECT * FROM mx_book where bid=?";
  pool.query(sql,[bid],(err,result)=>{
    if(err){
      console.log(err);
    }
    console.log(result);
    res.send(result);
  })
})

router.get('/pl/:bid',(req,res)=>{
  var bid = req.params.bid;
  console.log(bid)
  var sql ="SELECT * FROM evaluate where bid=?";
  pool.query(sql,[bid],(err,result)=>{
    if(err){
      console.log(err);
    }
    console.log(result);
    res.send(result);
  })
})

module.exports=router;
